<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:76:"D:\phpstudy_pro\WWW\nmg001\public/../application/admin\view\money\lists.html";i:1657873827;}*/ ?>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> <?php echo $setting['webname']; ?>- 收款记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/public/static/favicon.ico">
    <link rel="stylesheet" href="/public/static/admin/layui/css/layui.css">
    <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">


</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>收款记录</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="<?php echo url('Index/index'); ?>">主页</a>
                </li>
                <li>
                    <strong>收款记录列表</strong>
                </li>
            </ol>
        </div>
        <div class="col-sm-8" style="text-align: right;line-height: 15px;margin-top:25px;">

        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>记录列表</h5>
                        <div class="ibox-tools tools">
                            <!--<a href="<?php echo url('Applys/type_addform'); ?>"><i class="glyphicon glyphicon-plus" title="添加分类"></i></a>-->
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <div class="demoTable">
                                <div class="layui-inline">
                                    <select name="user_grade" id="grade" class="form-control">
                                        <option value="" readonly selected>年级</option>
                                    </select>
                                </div>
                                <div class="layui-inline">
                                    <input class="form-control" name="username" id="username" placeholder="姓名" autocomplete="off">
                                </div>
                                <div class="layui-inline">
                                    <input class="form-control" name="phone" id="phone" placeholder="电话" autocomplete="off">
                                </div>
                                <div class="layui-inline">
                                    <input class="form-control" name="major" id="major" placeholder="专业1" autocomplete="off">
                                </div>

                                <div class="layui-inline">
                                    <input type="text" placeholder="负责老师" name="teacher" id="teacher" class="input form-control">
                                </div>

                                <button class="btn btn-info" data-type="reload">搜索</button>
                                <div  class="layui-inline">
                                    <a href="<?php echo url('Money/jfExcel'); ?>" ><button type="button" class="btn btn-info btn-sm btn-block">导出缴费表</button></a>
                                </div>
                            </div>

                            <table class="layui-hide" id="test" lay-filter="test"></table>

                            <!--<script type="text/html" id="toolbarDemo">-->
                            <!--    <div class="layui-btn-container">-->
                            <!--        &lt;!&ndash;<button class="btn btn-danger" lay-event="deleteall">批量删除</button>&ndash;&gt;-->
                            <!--        &lt;!&ndash;<button class="layui-btn layui-btn-sm" lay-event="getCheckLength">获取选中数目</button>&ndash;&gt;-->
                            <!--        &lt;!&ndash;<button class="layui-btn layui-btn-sm" lay-event="isAll">验证是否全选</button>&ndash;&gt;-->
                            <!--    </div>-->
                            <!--</script>-->

                            <script type="text/html" id="barDemo" class="layui-btn-group">
                                <!--<a class="text-success" lay-event="edit"><i class="layui-icon"></i></a>-->
                                <!--<a class="text-danger" lay-event="del"><i class="layui-icon"></i></a>-->
                                <button type="button" class="btn btn-info btn-xs" style="padding:2px" lay-event="jl">收款记录</button>
                            </script>

                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>


    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>

    <!-- iCheck -->
    <script src="/public/static/admin/js/plugins/iCheck/icheck.min.js"></script>
    <!-- Switchery -->
    <script src="/public/static/admin/js/plugins/switchery/switchery.js"></script>

    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/layui/layui.js"></script>
    <script>
        var dateyear = new Date().getFullYear();
        for(i=dateyear;i>=dateyear-10;i--) {
            $("#grade").append($("<option value="+i+">"+i+"</option>"));
        }
        layui.use(['table','util'], function(){
            var table = layui.table,util = layui.util;
            var newyear = new Date().getFullYear();
            table.render({
                elem: '#test'
                ,url:"<?php echo url('Money/getAllUser'); ?>"
                ,toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
                ,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                    title: '提示'
                    ,layEvent: 'LAYTABLE_TIPS'
                    ,icon: 'layui-icon-tips'
                }]
                ,title: '用户数据表'
                ,cols: [[
                    ,{field:'userid', title:'ID', fixed: 'left', width:60, unresize: true, sort: true}
                    ,{field:'name', title:'用户名',fixed: 'left', width:120,align:"center"}
                    ,{field:'grade', title:'年级',sort:true, width:80}
                    ,{field:'sex', title:'性别', width:80, sort: true,templet:function(res){return  res.sex ? "男" :"女"}}
                    ,{field:'nation', title:'民族', width:100}
                    ,{field:'phone', title:'电话', width:150}
                    ,{field:'parenttel', title:'父母电话', width:150}
                    ,{field:'qqwx', title:'微信/QQ', width:150}
                    ,{field:'idcard', title:'身份证号', width:180}
                    ,{field:'address', title:'通讯地址', width:200}
                    ,{field:'schoolname', title:'毕业学校', width:200}
                    ,{field:'schooladdress', title:'学校地址', width:200}
                    ,{field:'score', title:'中考（模拟）成绩', width:200}
                    ,{field:'bktype', title:'报考类型',width:170}
                    ,{field:'major', title:'专业1',width:200}
                    ,{field:'major2', title:'专业2',width:200}
                    ,{field:'isadjust', title:'调剂', width:80, sort: true}
                    ,{field:'teacher', title:'负责老师', width:120, sort: true}
                    ,{field:'paytype', title:'支付类型', width:100, sort: true}
                    ,{field:'payid', title:'支付账号', width:140, sort: true}
                    ,{field:'apply_create_time', title:'报名时间', width:200, sort:true,templet:function(res){
                            return data(res.apply_create_time,"未报名");
                        }}
                    ,{field:'apply_update_time', title:'报名修改时间', width:200,templet:function(res){
                            return data(res.apply_update_time,"未修改");
                        }}
                    ,{field:'user_create_time', title:'用户注册时间', width:200,templet:function(res){
                            return data(res.user_create_time,"未注册");
                        }}
                    ,{field:'comment', title:'学员备注', width:150, sort: true}
                    ,{field:'reason', title:'拒绝理由', width:200, sort: true}
                    ,{field:'advice_note', title:'通知书编号', width:150, sort: true}
                    ,{field:'status', title:'状态', width:140, sort: true, templet:function(res){
                            var $str = "";
                            switch(res.status) {
                                case  "1" : $str = "缴费核对中";break;
                                case  "2" : $str = "<span style='color:green'>已录取</span>";break;
                                case  "3" : $str = "报名拒绝";break;
                                case  "4" : $str = "待支付";break;
                                case  "5" : $str = "报名信息审核中";break;
                            }
                            return $str;
                        }}
                    ,{fixed:'right',field:'money_count', title:'记录数', width:90, sort: true,align:'center'}
                    ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:90}
                ]]
                ,id: 'testReload'
                ,page: true
            });
            //将时间戳转为时间
            function data(timestamp,msg){
                if(timestamp > 0) {
                    var time = new Date(timestamp * 1000);
                    var y = time.getFullYear();
                    var m = time.getMonth() + 1;
                    var d = time.getDate();
                    var h = time.getHours();
                    var mm = time.getMinutes();
                    var s = time.getSeconds();
                    return y + '-' + add0(m) + '-' + add0(d) + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s);
                }else{
                    return msg
                }
            }
            //添加零
            function add0(m){return m<10?'0'+m:m }
            // //头工具栏事件
            // table.on('toolbar(test)', function(obj){
            //     var checkStatus = table.checkStatus(obj.config.id);
            //     switch(obj.event){
            //         case 'deleteall':
            //
            //             var data = checkStatus.data;
            //             if (data.length > 0) {
            //                 layer.confirm('确定删除选中的用户？', {icon: 3, title: '提示信息'}, function (index) {
            //                     //layui中找到CheckBox所在的行，并遍历找到行的顺序
            //                     $("div.layui-table-body table tbody input[name='layTableCheckbox']:checked").each(function (item) { // 遍历选中的checkbox
            //                         $.post("<?php echo url('Users/del'); ?>",{id:data[item].userid},function(){
            //
            //                         })
            //                         n = $(this).parents("tbody tr").index();  // 获取checkbox所在行的顺序
            //                         //移除行
            //                         $("div.layui-table-body table tbody ").find("tr:eq(" + n + ")").remove();
            //                         //如果是全选移除，就将全选CheckBox还原为未选中状态
            //                         $("div.layui-table-header table thead div.layui-unselect.layui-form-checkbox").removeClass("layui-form-checked");
            //
            //                     });
            //                     layer.close(index);
            //                 })
            //             } else {
            //                 layer.msg("请选择需要删除的行");
            //             }
            //             break;
            //
            //     }
            // });
            //
            // //监听行工具事件
            table.on('tool(test)', function(obj){
                // if(obj.event === 'del'){
                //     layer.confirm('真的删除学生【'+obj.data.name+'】吗？', function(index){
                //         $.post("<?php echo url('Users/del'); ?>",{id:obj.data.userid},function(){
                //             obj.del();
                //             layer.close(index);
                //         })
                //     });
                // }
                if(obj.event === "jl"){
                    // console.log(obj.data.userid);
                    location.href = "<?php echo url('Money/moneylist'); ?>?id="+obj.data.userid
                }
            });
            //
            // //监听单元格编辑
            // table.on('edit(test)', function(obj){
            //     $.post("<?php echo url('Users/user_update'); ?>",{id: obj.data.userid,field:obj.field,value:obj.value},function(data){
            //         layer.msg(data.msg,{time:1000,shade:0.5},function(){
            //             $('.demoTable .layui-btn').click();
            //         });
            //     })
            // });



            //搜索按钮
            var $ = layui.$, active = {
                reload: function(){
                    //执行重载
                    table.reload('testReload', {
                        page: {
                            curr: 1 //重新从第 1 页开始
                        }
                        ,where: {
                            name:$('#username').val(),
                            grade:$('#grade').val(),
                            phone:$('#phone').val(),
                            major:$('#major').val(),
                            teacher:$('#teacher').val(),
                        }
                    });
                    console.log($('#username').val());
                }

            };
            $('.demoTable .btn-info').on('click', function(){
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });

    </script>

    
    

</body>

</html>
